#include <iostream>
using namespace std;

struct Foo {
public:
    void setA(int a) {    _a = a;    }
    void setB(float b) {    _b = b;    }
    void setC(double c) {    _c = c;    }
    void print() const {
        cout << "_a:" << _a << endl;
        cout << "_b:" << _b << endl;
        cout << "_c:" << _c << endl;
    }
private:
    int _a;
    float _b;
    double _c;
};

int main() {
    Foo foo;//0. 创建foo对象
    
    //通过成员函数设置数据成员
    foo.setA(11);//ok，编译成功
    foo.setB(22.2f);
    foo.setC(33.3333);
    foo.print();
    return 0;
}

